import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import LayoutView from '../LayoutView.vue'

const routes = [
    {
        path: '/',
        redirect: '/home',
    },
    {
        path: '/',
        name: 'layout',
        component: LayoutView,
        children: [
          {
            path: 'home',
            name: 'home',
            component: () => import('../views/HomeView.vue')
          },
          {
            path: 'indent',
            name: 'indent',
            component: () => import('../views/IndentView.vue')
          },
          {
            path: 'my',
            name:'my',
            component: () => import('../views/MyView.vue')
          },
        ]
    },
    {
      path: '/settlement',
      name:'settlement',
      component: () => import('../views/SettlementView.vue')
    },
    {
      path: '/address',
      name: 'address',
      component: () => import('../views/AddressView.vue')
    },
    {
      path: '/details',
      name: 'details',
      component: () => import('../views/DetailsView.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    },
    {
      path: '/register',
      name:'register',
      component: () => import('../views/RegisterView.vue')
    },
    {
      path: '/order-success',
      name: 'order-success',
      component: () => import('../views/OrderSuccessView.vue')
    }
]

const router = new VueRouter({
  routes
})

export default router
